package com.hong.chapter3;

/**
 *
 * @author hong
 * @date 2018/5/28
 * 线程的属性
 *
 */
public class CreateThread {
    public static void main(String[] args) {
        Thread t1 = new Thread();
        Thread t2 = new Thread(){
            @Override
            public void run(){
                System.out.println("================");
            }
        };
        t1.start();
        t2.start();
        System.out.println(t1.getName());
        System.out.println(t2.getName());

        Thread th3 = new Thread("MyName");
        Thread th4 = new Thread(()->{
            System.out.println("Runnable...");
        });
        System.out.println(th3.getName());
        System.out.println(th4.getName());

        Thread t5 = new Thread(()->{
            System.out.println("Runnable..."+Thread.currentThread().getName());
        },"RunnableThread");
        t5.start();
    }
}
